' Sample declarations for Vaunix LDA DLL
' VB6 style
' This file should be correct, but has not been tested with VB6. Consider it as just some examples, and test accordingly

' Useful constants -- status values that can be returned

Const STATUS_OK As Long = 0
Const BAD_PARAMETER As Long = &H80010000
Const BAD_HID_IO As Long = &H80020000
Const DEVICE_NOT_READY As Long = &H80030000

Const INVALID_DEVID As Long = &H80000000
Const DEV_CONNECTED As Long = &H00000001
Const DEV_OPENED As Long = &H00000002
Const SWP_ACTIVE As Long = &H00000004
Const SWP_UP As Long = &H00000008
Const SWP_REPEAT As Long = &H00000010

' void fnLDA_SetTraceLevel(int tracelevel, int IOtracelevel, bool verbose);
' on 32 bit platforms a bool is passed as a 32 bit value on the stack, therefore it should be represented as a Long, with values of 0 (false) or 1 (true)
Declare Sub fnLDA_SetTraceLevel Lib "VNX_atten.dll" Alias "_fnLDA_SetTraceLevel@12" ( ByVal tracelevel As Long, ByVal IOtracelevel As Long, ByVal verbose As Long)

' void fnLDA_SetTestMode(bool testmode);
Declare Sub fnLDA_SetTestMode Lib "VNX_atten.dll" Alias "_fnLDA_SetTestMode@4" ( ByVal testmode As Long)

' int fnLDA_GetNumDevices();
Declare Function fnLDA_GetNumDevices Lib "VNX_atten.dll" Alias "_fnLDA_GetNumDevices@0" ( ) As Long

' int fnLDA_GetDevInfo(DEVID *ActiveDevices);
Declare Function fnLDA_GetDevInfo Lib "VNX_atten.dll" Alias "_fnLDA_GetDevInfo@4" ( ActiveDevicesFirstElement As Long) As Long
	
' int fnLDA_GetDeviceStatus(DEVID deviceID);	
Declare Function fnLDA_GetDeviceStatus Lib "VNX_atten.dll" Alias "_fnLDA_GetDeviceStatus@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetModelName(DEVID deviceID, char *ModelName);
' I have mapped the function to the Ascii version of the underlying function, there is also a unicode version exported by the DLL
' _fnLDA_GetModelNameW@8
' I don't know which lower level function VB6 uses, since normally the OS chooses the lower level function based on whether the application
' uses ASCII or Unicode strings.
Declare Function fnLDA_GetModelName Lib "VNX_atten.dll" Alias "_fnLDA_GetModelNameA@8" ( ByVal deviceID As Long, ByVal modelname As String) As Long

' int fnLDA_InitDevice(DEVID deviceID);
Declare Function fnLDA_InitDevice Lib "VNX_atten.dll" Alias "_fnLDA_InitDevice@4" ( ByVal deviceID As Long) As Long

' int fnLDA_CloseDevice(DEVID deviceID);
Declare Function fnLDA_CloseDevice Lib "VNX_atten.dll" Alias "_fnLDA_CloseDevice@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetSerialNumber(DEVID deviceID);
Declare Function fnLDA_GetSerialNumber Lib "VNX_atten.dll" Alias "_fnLDA_GetSerialNumber@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetDLLVersion();
Declare Function fnLDA_GetDLLVersion Lib "VNX_atten.dll" Alias "_fnLDA_GetDLLVersion@0" ( ) As Long

' int fnLDA_SetChannel(DEVID deviceID, int channel);
Declare Function fnLDA_SetChannel Lib "VNX_atten.dll" Alias "_fnLDA_SetChannel@8" ( ByVal deviceID As Long, ByVal channel As Long) As Long

' int fnLDA_SetWorkingFrequency(DEVID deviceID, int frequency);
Declare Function fnLDA_SetFrequency Lib "VNX_atten.dll" Alias "_fnLDA_SetWorkingFrequency@8" ( ByVal deviceID As Long, ByVal frequency As Long) As Long

' int fnLDA_SetAttenuation(DEVID deviceID, int attenuation);
Declare Function fnLDA_SetAttenuation Lib "VNX_atten.dll" Alias "_fnLDA_SetAttenuation@8" ( ByVal deviceID As Long, ByVal attenuation As Long) As Long

' int fnLDA_SetAttenuationHR(DEVID deviceID, int attenuation);
Declare Function fnLDA_SetAttenuationHR Lib "VNX_atten.dll" Alias "_fnLDA_SetAttenuationHR@8" ( ByVal deviceID As Long, ByVal attenuation As Long) As Long

' int fnLDA_SetAttenuationHRQ(DEVID deviceID, int attenuation, int channel );
Declare Function fnLDA_SetAttenuationHRQ Lib "VNX_atten.dll" Alias "_fnLDA_SetAttenuationHRQ@12" ( ByVal deviceID As Long, ByVal attenuation As Long, ByVal channel As Long) As Long

' int fnLDA_SetRampStart(DEVID deviceID, int rampstart);
Declare Function fnLDA_SetRampStart Lib "VNX_atten.dll" Alias "_fnLDA_SetRampStart@8" ( ByVal deviceID As Long, ByVal rampstart As Long) As Long

' int fnLDA_SetRampStartHR(DEVID deviceID, int rampstart);
Declare Function fnLDA_SetRampStartHR Lib "VNX_atten.dll" Alias "_fnLDA_SetRampStartHR@8" ( ByVal deviceID As Long, ByVal rampstart As Long) As Long

' int fnLDA_SetRampEnd(DEVID deviceID, int rampstop);
Declare Function fnLDA_SetRampEnd Lib "VNX_atten.dll" Alias "_fnLDA_SetRampEnd@8" ( ByVal deviceID As Long, ByVal rampstop As Long) As Long

' int fnLDA_SetRampEndHR(DEVID deviceID, int rampstop);
Declare Function fnLDA_SetRampEndHR Lib "VNX_atten.dll" Alias "_fnLDA_SetRampEndHR@8" ( ByVal deviceID As Long, ByVal rampstop As Long) As Long

' int fnLDA_SetAttenuationStep(DEVID deviceID, int attenuationstep);
Declare Function fnLDA_SetAttenuationStep Lib "VNX_atten.dll" Alias "_fnLDA_SetAttenuationStep@8" ( ByVal deviceID As Long, ByVal attenuationstep As Long) As Long

' int fnLDA_SetAttenuationStepHR(DEVID deviceID, int attenuationstep);
Declare Function fnLDA_SetAttenuationStepHR Lib "VNX_atten.dll" Alias "_fnLDA_SetAttenuationStepHR@8" ( ByVal deviceID As Long, ByVal attenuationstep As Long) As Long

' int fnLDA_SetAttenuationStepTwo(DEVID deviceID, int attenuationstep2);
Declare Function fnLDA_SetAttenuationStepTwo Lib "VNX_atten.dll" Alias "_fnLDA_SetAttenuationStepTwo@8" ( ByVal deviceID As Long, ByVal attenuationstep2 As Long) As Long

' int fnLDA_SetAttenuationStepTwoHR(DEVID deviceID, int attenuationstep2);
Declare Function fnLDA_SetAttenuationStepTwoHR Lib "VNX_atten.dll" Alias "_fnLDA_SetAttenuationStepTwoHR@8" ( ByVal deviceID As Long, ByVal attenuationstep2 As Long) As Long

' int fnLDA_SetDwellTime(DEVID deviceID, int dwelltime);
Declare Function fnLDA_SetDwellTime Lib "VNX_atten.dll" Alias "_fnLDA_SetDwellTime@8" ( ByVal deviceID As Long, ByVal dwelltime As Long) As Long

' int fnLDA_SetDwellTimeTwo(DEVID deviceID, int dwelltime2);
Declare Function fnLDA_SetDwellTimeTwo Lib "VNX_atten.dll" Alias "_fnLDA_SetDwellTimeTwo@8" ( ByVal deviceID As Long, ByVal dwelltime2 As Long) As Long

' int fnLDA_SetIdleTime(DEVID deviceID, int idletime);
Declare Function fnLDA_SetIdleTime Lib "VNX_atten.dll" Alias "_fnLDA_SetIdleTime@8" ( ByVal deviceID As Long, ByVal idletime As Long) As Long

' int fnLDA_SetHoldTime(DEVID deviceID, int holdtime);
Declare Function fnLDA_SetHoldTime Lib "VNX_atten.dll" Alias "_fnLDA_SetHoldTime@8" ( ByVal deviceID As Long, ByVal holdtime As Long) As Long

' int fnLDA_SetProfileElement(DEVID deviceID, int index, int attenuation);
Declare Function fnLDA_SetProfileElement Lib "VNX_atten.dll" Alias "_fnLDA_SetProfileElement@12" ( ByVal deviceID As Long, ByVal index As Long, ByVal attenuation As Long) As Long

' int fnLDA_SetProfileElementHR(DEVID deviceID, int index, int attenuation);
Declare Function fnLDA_SetProfileElementHR Lib "VNX_atten.dll" Alias "_fnLDA_SetProfileElementHR@12" ( ByVal deviceID As Long, ByVal index As Long, ByVal attenuation As Long) As Long

' int fnLDA_SetProfileCount(DEVID deviceID, int profilecount);
Declare Function fnLDA_SetProfileCount Lib "VNX_atten.dll" Alias "_fnLDA_SetProfileCount@8" ( ByVal deviceID As Long, ByVal profilecount As Long) As Long

' int fnLDA_SetProfileIdleTime(DEVID deviceID, int idletime);
Declare Function fnLDA_SetProfileIdleTime Lib "VNX_atten.dll" Alias "_fnLDA_SetProfileIdleTime@8" ( ByVal deviceID As Long, ByVal idletime As Long) As Long

' int fnLDA_SetProfileDwellTime(DEVID deviceID, int dwelltime);
Declare Function fnLDA_SetProfileDwellTime Lib "VNX_atten.dll" Alias "_fnLDA_SetProfileDwellTime@8" ( ByVal deviceID As Long, ByVal dwelltime As Long) As Long

' int fnLDA_StartProfile(DEVID deviceID, int mode);
Declare Function fnLDA_StartProfile Lib "VNX_atten.dll" Alias "_fnLDA_StartProfile@8" ( ByVal deviceID As Long, ByVal mode As Long) As Long
	
' int fnLDA_StartProfileMC(DEVID deviceID, int mode, int chmask, bool delayed);
Declare Function fnLDA_StartProfileMC Lib "VNX_atten.dll" Alias "_fnLDA_StartProfileMC@16" ( ByVal deviceID As Long, ByVal mode As Long, ByVal chmask As Long, ByVal delayed As Long) As Long
	
' int fnLDA_SetRFOn(DEVID deviceID, bool on);
Declare Function fnLDA_SetRFOn Lib "VNX_atten.dll" Alias "_fnLDA_SetRFOn@8" ( ByVal deviceID As Long, ByVal rf_on As Long) As Long

' int fnLDA_SetRampDirection(DEVID deviceID, bool up);
Declare Function fnLDA_SetRampDirection Lib "VNX_atten.dll" Alias "_fnLDA_SetRampDirection@8" ( ByVal deviceID As Long, ByVal up As Long) As Long

' int fnLDA_SetRampMode(DEVID deviceID, bool mode);
Declare Function fnLDA_SetRampMode Lib "VNX_atten.dll" Alias "_fnLDA_SetRampMode@8" ( ByVal deviceID As Long, ByVal mode As Long) As Long

' int fnLDA_SetRampBidirectional(DEVID deviceID, bool bidir_enable);
Declare Function fnLDA_SetRampBidirectional Lib "VNX_atten.dll" Alias "_fnLDA_SetRampBidirectional@8" ( ByVal deviceID As Long, ByVal bidir_enable As Long) As Long

' int fnLDA_StartRamp(DEVID deviceID, bool go);
Declare Function fnLDA_StartRamp Lib "VNX_atten.dll" Alias "_fnLDA_StartRamp@8" ( ByVal deviceID As Long, ByVal go As Long) As Long

' int fnLDA_StartRampMC(DEVID deviceID, int mode, int chmask, bool deferred);
Declare Function fnLDA_StartRampMC Lib "VNX_atten.dll" Alias "_fnLDA_StartRampMC@16" ( ByVal deviceID As Long, ByVal mode As Long, ByVal chmask As Long, ByVal delayed As Long) As Long

' int fnLDA_SaveSettings(DEVID deviceID);
Declare Function fnLDA_SaveSettings Lib "VNX_atten.dll" Alias "_fnLDA_SaveSettings@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetWorkingFrequency(DEVID deviceID);
Declare Function fnLDA_GetWorkingFrequency Lib "VNX_atten.dll" Alias "_fnLDA_GetWorkingFrequency@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetMinWorkingFrequency(DEVID deviceID);
Declare Function fnLDA_GetMinWorkingFrequency Lib "VNX_atten.dll" Alias "_fnLDA_GetMinWorkingFrequency@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetMaxWorkingFrequency(DEVID deviceID);
Declare Function fnLDA_GetMaxWorkingFrequency Lib "VNX_atten.dll" Alias "_fnLDA_GetMaxWorkingFrequency@4" ( ByVal deviceID As Long) As Long
	
' int fnLDA_GetAttenuation(DEVID deviceID);
Declare Function fnLDA_GetAttenuation Lib "VNX_atten.dll" Alias "_fnLDA_GetAttenuation@4" ( ByVal deviceID As Long) As Long
	
' int fnLDA_GetAttenuationHR(DEVID deviceID);
Declare Function fnLDA_GetAttenuationHR Lib "VNX_atten.dll" Alias "_fnLDA_GetAttenuationHR@4" ( ByVal deviceID As Long) As Long
	
' int fnLDA_GetRampStart(DEVID deviceID);
Declare Function fnLDA_GetRampStart Lib "VNX_atten.dll" Alias "_fnLDA_GetRampStart@4" ( ByVal deviceID As Long) As Long
	
' int fnLDA_GetRampStartHR(DEVID deviceID);
Declare Function fnLDA_GetRampStartHR Lib "VNX_atten.dll" Alias "_fnLDA_GetRampStartHR@4" ( ByVal deviceID As Long) As Long	

' int fnLDA_GetRampEnd(DEVID deviceID);
Declare Function fnLDA_GetRampEnd Lib "VNX_atten.dll" Alias "_fnLDA_GetRampEnd@4" ( ByVal deviceID As Long) As Long
	
' int fnLDA_GetRampEndHR(DEVID deviceID);
Declare Function fnLDA_GetRampEndHR Lib "VNX_atten.dll" Alias "_fnLDA_GetRampEndHR@4" ( ByVal deviceID As Long) As Long	
	
' int fnLDA_GetDwellTime(DEVID deviceID);
Declare Function fnLDA_GetDwellTime Lib "VNX_atten.dll" Alias "_fnLDA_GetDwellTimeTime@4" ( ByVal deviceID As Long) As Long
	
' int fnLDA_GetDwellTimeTwo(DEVID deviceID);
Declare Function fnLDA_GetDwellTimeTwo Lib "VNX_atten.dll" Alias "_fnLDA_GetDwellTimeTimeTwo@4" ( ByVal deviceID As Long) As Long	
	
' int fnLDA_GetIdleTime(DEVID deviceID);
Declare Function fnLDA_GetIdleTime Lib "VNX_atten.dll" Alias "_fnLDA_GetIdleTimeTime@4" ( ByVal deviceID As Long) As Long	

' int fnLDA_GetHoldTime(DEVID deviceID);
Declare Function fnLDA_GetHoldTime Lib "VNX_atten.dll" Alias "_fnLDA_GetHoldTimeTime@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetAttenuationStep(DEVID deviceID);
Declare Function fnLDA_GetAttenuationStep Lib "VNX_atten.dll" Alias "_fnLDA_GetAttenuationStep@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetAttenuationStepHR(DEVID deviceID);
Declare Function fnLDA_GetAttenuationStepHR Lib "VNX_atten.dll" Alias "_fnLDA_GetAttenuationStepHR@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetAttenuationStepTwo(DEVID deviceID);
Declare Function fnLDA_GetAttenuationStepTwo Lib "VNX_atten.dll" Alias "_fnLDA_GetAttenuationStepTwo@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetAttenuationStepTwoHR(DEVID deviceID);
Declare Function fnLDA_GetAttenuationStepTwoHR Lib "VNX_atten.dll" Alias "_fnLDA_GetAttenuationStepTwoHR@4" ( ByVal deviceID As Long) As Long
	
' int fnLDA_GetRF_On(DEVID deviceID);
Declare Function fnLDA_GetRF_On Lib "VNX_atten.dll" Alias "_fnLDA_GetRF_On@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetProfileElement(DEVID deviceID, int index);
Declare Function fnLDA_GetProfileElement Lib "VNX_atten.dll" Alias "_fnLDA_GetProfileElement@8" ( ByVal deviceID As Long, ByVal index As Long) As Long

' int fnLDA_GetProfileElementHR(DEVID deviceID, int index);
Declare Function fnLDA_GetProfileElementHR Lib "VNX_atten.dll" Alias "_fnLDA_GetProfileElementHR@8" ( ByVal deviceID As Long, ByVal index As Long) As Long

' int fnLDA_GetProfileCount(DEVID deviceID);
Declare Function fnLDA_GetProfileCount Lib "VNX_atten.dll" Alias "_fnLDA_GetProfileCount@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetProfileIdleTime(DEVID deviceID);
Declare Function fnLDA_GetProfileIdleTime Lib "VNX_atten.dll" Alias "_fnLDA_GetProfileIdleTime@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetProfileDwellTime(DEVID deviceID);
Declare Function fnLDA_GetProfileDwellTime Lib "VNX_atten.dll" Alias "_fnLDA_GetProfileDwellTime@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetProfileIndex(DEVID deviceID);
Declare Function fnLDA_GetProfileIndex Lib "VNX_atten.dll" Alias "_fnLDA_GetProfileIndex@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetMaxAttenuation(DEVID deviceID);
Declare Function fnLDA_GetMaxAttenuation Lib "VNX_atten.dll" Alias "_fnLDA_GetMaxAttenuation@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetMaxAttenuationHR(DEVID deviceID);
Declare Function fnLDA_GetMaxAttenuationHR Lib "VNX_atten.dll" Alias "_fnLDA_GetMaxAttenuationHR@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetMinAttenuation(DEVID deviceID);
Declare Function fnLDA_GetMinAttenuation Lib "VNX_atten.dll" Alias "_fnLDA_GetMinAttenuation@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetMinAttenuationHR(DEVID deviceID);
Declare Function fnLDA_GetMinAttenuationHR Lib "VNX_atten.dll" Alias "_fnLDA_GetMinAttenuationHR@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetMinAttenuationStep(DEVID deviceID);
Declare Function fnLDA_GetMinAttenuationStep Lib "VNX_atten.dll" Alias "_fnLDA_GetMinAttenuationStep@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetMinAttenuationStepHR(DEVID deviceID);
Declare Function fnLDA_GetMinAttenuationStepHR Lib "VNX_atten.dll" Alias "_fnLDA_GetMinAttenuationStepHR@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetFeatures(DEVID deviceID);
Declare Function fnLDA_GetFeatures Lib "VNX_atten.dll" Alias "_fnLDA_GetFeatures@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetNumChannels(DEVID deviceID);
Declare Function fnLDA_GetNumChannels Lib "VNX_atten.dll" Alias "_fnLDA_GetNumChannels@4" ( ByVal deviceID As Long) As Long

' int fnLDA_GetProfileMaxLength(DEVID deviceID);
Declare Function fnLDA_GetProfileMaxLength Lib "VNX_atten.dll" Alias "_fnLDA_GetProfileMaxLength@4" ( ByVal deviceID As Long) As Long